<%@ page import="kgc.NewsService.NewsService" %>
<%@ page import="kgc.NewsServiceImpl.NewsServiceImpl" %>
<%@ page import="java.util.List" %>
<%@ page import="kgc.pojo.News_Category" %>
<%@ page import="kgc.pojo.News_User" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/4/6
  Time: 12:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        int id = Integer.parseInt(request.getParameter("id"));
        int num = Integer.parseInt(request.getParameter("num"));
        NewsService service = new NewsServiceImpl();
        List<Object> list = service.ServiceSelectById(id, num);
        for (Object obj : list){
            if (obj instanceof News_Category){
                News_Category category = (News_Category) obj;
                session.setAttribute("category",category);
                session.setAttribute("num",num);
                response.sendRedirect(request.getContextPath()+"/UpdateInfo.jsp");
            }else if (obj instanceof News_User){
                News_User user = (News_User) obj;
                session.setAttribute("user",user);
                session.setAttribute("num",num);
                response.sendRedirect(request.getContextPath()+"/UpdateInfo.jsp");
            }
        }
    %>

</body>
</html>
